package main

import (
	"fmt"
	"sort"
)

type day struct {
	num       int
	shortName string
	longName  string
}

type dayArray struct {
	data []*day
}

func (p *dayArray) Len() int {
	return len(p.data)
}

func (p *dayArray) Less(i, j int) bool {
	return p.data[i].num < p.data[j].num
}

func (p *dayArray) Swap(i, j int) {
	p.data[i], p.data[j] = p.data[j], p.data[i]
}

func days() {
	data := []*day{
		&day{1, "SUN", "Sunday"},
		&day{2, "MON", "Monday"},
		&day{3, "TUE", "Tuesday"},
		&day{4, "WED", "Wednesday"},
		&day{5, "THU", "Thursday"},
		&day{6, "FRI", "Friday"},
		&day{7, "SAT", "Saturday"},
	}
	array := dayArray{data}
	sort.Sort(&array)
	if !sort.IsSorted(&array) {
		panic("fail")
	}
	for _, d := range data {
		fmt.Printf("%s ", d.longName)
	}
	fmt.Printf("\n")
}
func main() {

	days()

}
